<template>
  <div id="app">
    <!--表格-->
    <el-table
      :data="tableData"
      border
      style="width: 100%">
      <el-table-column
        fixed
        prop="ID"
        label="编号"
        width="150">
      </el-table-column>
      <el-table-column
        prop="UserName"
        label="姓名"
        width="170">
      </el-table-column>
      <el-table-column
        prop="Address"
        label="地址"
        width="300">
      </el-table-column>
      <el-table-column
        prop="Time"
        label="预约时间"
        width="340">
      </el-table-column>
      <el-table-column
        fixed="right"
        label="操作"
        width="400">
        <template slot-scope="scope">
          <el-button @click="memberDel(scope.row)" type="text" size="small">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @current-change="handleCurrentChange"
      style="margin-left: 550px;margin-top: 20px"
      background
      layout="prev, pager, next"
      :total="300"
    >
    </el-pagination>
  </div>
</template>

<script>
  export default {
    methods: {
      memberDel(row) {
        this.axios.delete("/api/userinfo/"+row.ID).then(alert("删除成功！"))
      }, handleCurrentChange: function(currentPage){
        this.currentPage = currentPage;
        this.handleUserList();
      },handleUserList(){
        this.axios.get("/api/userinfo/"+((this.currentPage-1)*13)).then(res => {this.tableData=res.data})
      }
    },
    data() {
      return {
        input:"",
        tableData:[],
        currentPage:1,
        pageSize:10,
      }
    }
    ,created() {
      this.handleUserList()
    }
  }
</script>

<style scoped>

</style>
